package com.qf.pkg.service.impl;

import com.qf.vo.R;
import com.qf.pkg.entity.Package;
import com.qf.pkg.mapper.PackageMapper;
import com.qf.pkg.service.PackageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * <p>
 * 租户套餐表 服务实现类
 * </p>
 *
 * @author 程序员
 * @since 2023-10-28
 */
@Service
public class PackageServiceImpl extends ServiceImpl<PackageMapper, Package> implements PackageService {

    @Override
    @Transactional
    public R add(Package pck) {
        if (pck==null)
        {
            return  R.fail();
        }
        pck.setCreator("1");
        pck.setCreateTime(new Date());
        pck.setUpdater("1");
        pck.setUpdateTime(new Date());
        pck.setStatus(0);
        pck.setDeleted(0);
        this.baseMapper.insert(pck);


        return R.ok();
    }
}
